package com.umanji.building.domain;

import java.util.Collection;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import com.umanji.generic.entity.UUIDEntity;

@Entity
@Table(name="umanji_public_official_building", uniqueConstraints = {@UniqueConstraint(columnNames={"BUILDING_NO"})})
public class PublicOfficialBuildings extends UUIDEntity<PublicOfficialBuildings> {

	@OneToMany(cascade=CascadeType.ALL, mappedBy="publicOfficialBuilding")
	@OrderBy("regDate")
	private Set<BuildingInfos> buildingInfos;		// 빌딩 정보

	@OneToMany(cascade=CascadeType.ALL, mappedBy="publicOfficialBuilding")
	@OrderBy("regDate")
	private Set<PublicOfficialBuildingBoards> POBBoard;		// 게시판

	@OneToMany(cascade=CascadeType.ALL, mappedBy="publicOfficialBuilding")
	@OrderBy("regDate")
	private Set<PublicOfficialBuildingAdmins> POBAdmin;		// 관리자

	@Column(name="BUILDING_NO", length=25)
	private String buildingNo;

	@Column(name="DIVISION", length=5)
	private String division;

	@Column(name="NAME", length=250)
	private String name;

	@Temporal(TemporalType.DATE)
	private Date regDate;

	public Date getRegDate() {
		return regDate;
	}

	public void setRegDate(Date regDate) {
		this.regDate = regDate;
	}

	public String getBuildingNo() {
		return buildingNo;
	}
	public void setBuildingNo(String buildingNo) {
		this.buildingNo = buildingNo;
	}

	public String getDivision() {
		return division;
	}

	public void setDivision(String division) {
		this.division = division;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setPOBBoard(Set<PublicOfficialBuildingBoards> pOBBoard) {
		POBBoard = pOBBoard;
	}

	public Set<PublicOfficialBuildingBoards> getPOBBoard() {
		return POBBoard;
	}

	public void setBuildingInfos(Set<BuildingInfos> buildingInfos) {
		this.buildingInfos = buildingInfos;
	}

	public Set<BuildingInfos> getBuildingInfos() {
		return buildingInfos;
	}

	public void setPOBAdmin(Set<PublicOfficialBuildingAdmins> pOBAdmin) {
		POBAdmin = pOBAdmin;
	}

	public Set<PublicOfficialBuildingAdmins> getPOBAdmin() {
		return POBAdmin;
	}

}
